package com.xiake.core.spring;

import java.util.Properties;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

import com.xiake.core.constants.FileConstants;
import com.xiake.core.constants.WebUrlConstants;

public class PropertyPlaceholderConfigurerExt extends PropertyPlaceholderConfigurer {

	  @Override
	  protected void processProperties(ConfigurableListableBeanFactory beanFactory, Properties props)
	      throws BeansException {
		  super.processProperties(beanFactory, props);
		  WebUrlConstants.mainHost = props.getProperty("host.main");
		  WebUrlConstants.staticHost = props.getProperty("host.static");
		  FileConstants.BASE_FILE_PATH = props.getProperty("file.base.path");
	  }
}
